package hubol;

import java.awt.event.MouseEvent;

import bogus.userInput.Input;
import owg.util.Calc;

public class ClickableRectangle {
public int x1, y1, x2, y2;
	
	public ClickableRectangle(int x1, int y1, int w, int h){
		this.x1 = x1;
		this.y1 = y1;
		this.x2 = x1 + w;
		this.y2 = y1 + h;
	}
	
	public boolean moused(){
		return Calc.isContained(Input.mouseX, x1, x2) && Calc.isContained(Input.mouseY, y1, y2);
	}
	
	public boolean clicked(){
		return Input.checkFrameButton(MouseEvent.BUTTON1) && moused();
	}

}
